import ajax from './index'

export interface UserInfo {
  id: number,
  name: string,
  password: string,
  created_at: string,
  updated_at: string,
  phone: string,
  user_name: string
}

export interface loginParam {
  name: string
  password: string
}

export interface loginRes {
  userInfo: UserInfo
  token: string
}

export function userLogin (param: loginParam): Promise<loginRes> {
  return ajax('/login', param, 'post')
}
